3.175 \(\int (a+b \sec (c+d x))^2 \sin ^3(c+d x) \, dx\)

Optimal. Leaf size=80 \[ -\frac{\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac{a^2 \cos ^3(c+d x)}{3 d}+\frac{a b \cos ^2(c+d x)}{d}-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \sec (c+d x)}{d} \]

[Out]

-(((a^2 - b^2)*Cos[c + d*x])/d) + (a*b*Cos[c + d*x]^2)/d + (a^2*Cos[c + d*x]^3)/(3*d) - (2*a*b*Log[Cos[c + d*x
]])/d + (b^2*Sec[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.144795, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3872, 2837, 12, 894} \[ -\frac{\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac{a^2 \cos ^3(c+d x)}{3 d}+\frac{a b \cos ^2(c+d x)}{d}-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[c + d*x])^2*Sin[c + d*x]^3,x]

[Out]

-(((a^2 - b^2)*Cos[c + d*x])/d) + (a*b*Cos[c + d*x]^2)/d + (a^2*Cos[c + d*x]^3)/(3*d) - (2*a*b*Log[Cos[c + d*x
]])/d + (b^2*Sec[c + d*x])/d

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rule 2837

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps

\begin{align*} \int (a+b \sec (c+d x))^2 \sin ^3(c+d x) \, dx &=\int (-b-a \cos (c+d x))^2 \sin (c+d x) \tan ^2(c+d x) \, dx\\ &=\frac{\operatorname{Subst}\left (\int \frac{a^2 (-b+x)^2 \left (a^2-x^2\right )}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a^3 d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{(-b+x)^2 \left (a^2-x^2\right )}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=\frac{\operatorname{Subst}\left (\int \left (a^2 \left (1-\frac{b^2}{a^2}\right )+\frac{a^2 b^2}{x^2}-\frac{2 a^2 b}{x}+2 b x-x^2\right ) \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=-\frac{\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac{a b \cos ^2(c+d x)}{d}+\frac{a^2 \cos ^3(c+d x)}{3 d}-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \sec (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.176215, size = 72, normalized size = 0.9 \[ \frac{\left (12 b^2-9 a^2\right ) \cos (c+d x)+a^2 \cos (3 (c+d x))+6 a b \cos (2 (c+d x))-24 a b \log (\cos (c+d x))+12 b^2 \sec (c+d x)}{12 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[c + d*x])^2*Sin[c + d*x]^3,x]

[Out]

((-9*a^2 + 12*b^2)*Cos[c + d*x] + 6*a*b*Cos[2*(c + d*x)] + a^2*Cos[3*(c + d*x)] - 24*a*b*Log[Cos[c + d*x]] + 1
2*b^2*Sec[c + d*x])/(12*d)

________________________________________________________________________________________

Maple [A]  time = 0.039, size = 125, normalized size = 1.6 \begin{align*} -{\frac{{a}^{2}\cos \left ( dx+c \right ) \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{3\,d}}-{\frac{2\,{a}^{2}\cos \left ( dx+c \right ) }{3\,d}}-{\frac{ab \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{d}}-2\,{\frac{ab\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{d\cos \left ( dx+c \right ) }}+{\frac{{b}^{2}\cos \left ( dx+c \right ) \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{d}}+2\,{\frac{{b}^{2}\cos \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(d*x+c))^2*sin(d*x+c)^3,x)

[Out]

-1/3/d*a^2*cos(d*x+c)*sin(d*x+c)^2-2/3*a^2*cos(d*x+c)/d-1/d*a*b*sin(d*x+c)^2-2*a*b*ln(cos(d*x+c))/d+1/d*b^2*si
n(d*x+c)^4/cos(d*x+c)+1/d*b^2*cos(d*x+c)*sin(d*x+c)^2+2/d*b^2*cos(d*x+c)

________________________________________________________________________________________

Maxima [A]  time = 0.962144, size = 96, normalized size = 1.2 \begin{align*} \frac{a^{2} \cos \left (d x + c\right )^{3} + 3 \, a b \cos \left (d x + c\right )^{2} - 6 \, a b \log \left (\cos \left (d x + c\right )\right ) - 3 \,{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) + \frac{3 \, b^{2}}{\cos \left (d x + c\right )}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^2*sin(d*x+c)^3,x, algorithm="maxima")

[Out]

1/3*(a^2*cos(d*x + c)^3 + 3*a*b*cos(d*x + c)^2 - 6*a*b*log(cos(d*x + c)) - 3*(a^2 - b^2)*cos(d*x + c) + 3*b^2/
cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.81172, size = 228, normalized size = 2.85 \begin{align*} \frac{2 \, a^{2} \cos \left (d x + c\right )^{4} + 6 \, a b \cos \left (d x + c\right )^{3} - 12 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - 3 \, a b \cos \left (d x + c\right ) - 6 \,{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 6 \, b^{2}}{6 \, d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^2*sin(d*x+c)^3,x, algorithm="fricas")

[Out]

1/6*(2*a^2*cos(d*x + c)^4 + 6*a*b*cos(d*x + c)^3 - 12*a*b*cos(d*x + c)*log(-cos(d*x + c)) - 3*a*b*cos(d*x + c)
 - 6*(a^2 - b^2)*cos(d*x + c)^2 + 6*b^2)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))**2*sin(d*x+c)**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.3138, size = 135, normalized size = 1.69 \begin{align*} -\frac{2 \, a b \log \left (\frac{{\left | \cos \left (d x + c\right ) \right |}}{{\left | d \right |}}\right )}{d} + \frac{b^{2}}{d \cos \left (d x + c\right )} + \frac{a^{2} d^{5} \cos \left (d x + c\right )^{3} + 3 \, a b d^{5} \cos \left (d x + c\right )^{2} - 3 \, a^{2} d^{5} \cos \left (d x + c\right ) + 3 \, b^{2} d^{5} \cos \left (d x + c\right )}{3 \, d^{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^2*sin(d*x+c)^3,x, algorithm="giac")

[Out]

-2*a*b*log(abs(cos(d*x + c))/abs(d))/d + b^2/(d*cos(d*x + c)) + 1/3*(a^2*d^5*cos(d*x + c)^3 + 3*a*b*d^5*cos(d*
x + c)^2 - 3*a^2*d^5*cos(d*x + c) + 3*b^2*d^5*cos(d*x + c))/d^6